package com.gec.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gec.system.mapper.SysLoginLogMapper;
import com.gec.system.sevice.SysLoginLogService;
import com.gec.system.system.SysLoginLog;
import com.gec.system.vo.SysLoginLogQueryVo;
import org.springframework.stereotype.Service;

@Service
public class SysLoginLogServiceImpl extends ServiceImpl<SysLoginLogMapper, SysLoginLog> implements SysLoginLogService {
    @Override
    public void recordLoginLog(String username, Integer status, String ipaddr, String msg) {
        SysLoginLog sysLoginLog = new
                SysLoginLog();
        sysLoginLog.setUsername(username);
        sysLoginLog.setStatus(status);
        sysLoginLog.setIpaddr(ipaddr);
        sysLoginLog.setMsg(msg);
        this.baseMapper.insert(sysLoginLog);
    }

    @Override
    public IPage<SysLoginLog> selectPage(IPage<SysLoginLog> page, SysLoginLogQueryVo vo) {
        return baseMapper.selectPage(page,vo);
    }
}
